﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bike.Repository;
namespace Bike.Biz
{
    public class ProductService : BikeService<Product>
    {
       public static Product AddProduct(Product product) {

           var context = ContextManager.GetInstance();
           var contextAdapter = new ObjectContextAdapter(context);

           var unitOfWork = new UnitOfWork(contextAdapter);

           var repository = new Repository<Product>(contextAdapter);
           repository.Add(product);
           unitOfWork.Commit();
           
           return product;
       }
    }
}
